using System;

namespace TaskPluginInterface
{
    /// <summary>
    /// The event arguments for the Plugin
    /// </summary>
    public class PluginEventArgs : EventArgs
    {
        #region Constructors

        /// <summary>
        /// Creates a new instance of the PluginEventArgs
        /// </summary>
        /// <param name="progress">A <see cref="Utilities.Progress"/> <c>struct</c> which indicates the
        /// current progress of the Plugin</param>
        /// <param name="message">A message to return back to the plug-in Host</param>
        /// <param name="raisedException">Any exception that might have been raised.</param>
        public PluginEventArgs(
           Utilities.Progress progress,
           string message,
           Exception raisedException)
        {
            _progress = progress;
            _message = message;
            _raisedException = raisedException;
        }


        #endregion Constructors

        #region Private Variables

        private readonly Utilities.Progress _progress;
        private readonly string _message = "";
        private readonly Exception _raisedException;

        #endregion Private Variables

        #region Public Variables

        /// <summary>
        /// Indicates the current progress of the Plugin.
        /// </summary>
        public Utilities.Progress Progress
        {
            get { return _progress; }
        }
        
        /// <summary>
        /// A message returned from the Plugin
        /// </summary>
        public string Message
        {
            get { return _message; }
        }

        /// <summary>
        /// An exception raised from the Plugin
        /// </summary>
        public Exception RaisedException
        {
            get { return _raisedException; }
        }

        /// <summary>
        /// Indicates if the operation should be canceled.
        /// </summary>
        public bool Cancel { get; set; }

        #endregion Public Variables

    }

}
